require("../../common/vendor.js"), (global.webpackJsonp = global.webpackJsonp || []).push([ [ "pagesA/pages/mallA/search" ], {
    "3c72": function(t, n, a) {
        (function(i) {
            Object.defineProperty(n, "__esModule", {
                value: !0
            }), n.default = void 0;
            var t, o = (t = a("a34a")) && t.__esModule ? t : {
                default: t
            };
            function s(t, e, n, a, o, i, r) {
                try {
                    var c = t[i](r), s = c.value;
                } catch (t) {
                    return n(t), 0;
                }
                c.done ? e(s) : Promise.resolve(s).then(a, o);
            }
            function r(c) {
                return function() {
                    var t = this, r = arguments;
                    return new Promise(function(e, n) {
                        var a = c.apply(t, r);
                        function o(t) {
                            s(a, e, n, o, i, "next", t);
                        }
                        function i(t) {
                            s(a, e, n, o, i, "throw", t);
                        }
                        o(void 0);
                    });
                };
            }
            var c = getApp(), e = {
                data: function() {
                    return {
                        module_name: c.globalData.module_name,
                        userinfo: i.getStorageSync("userinfo"),
                        setting: i.getStorageSync("setting"),
                        sharetitle: "",
                        sharepic: "",
                        showAlert_login: !1,
                        wxCode: "",
                        scrollTimer: null,
                        top: 0,
                        footerCurrent: 0,
                        cityid: 40,
                        cityCode: 500100,
                        lat: 0,
                        lon: 0,
                        navItems: [],
                        navIndex: 0,
                        navType: "",
                        mallpage: 1,
                        mallpagesize: 20,
                        mallgoodslist: [],
                        loadStatus: "loadmore",
                        loadText: {
                            loadmore: "上拉加载更多",
                            loading: "努力加载中",
                            nomore: "实在没有了"
                        },
                        scrollTop: 0,
                        windowHeight: i.getStorageSync("windowHeight"),
                        navQuery: "",
                        background: {
                            backgroundColor: i.getStorageSync("setting").waimaittnew_lunbobgcolor
                        },
                        search_width: "",
                        isFixed: !1,
                        headerHeight: 0,
                        nav_margin_top: "0rpx",
                        nav_padding_top: "0rpx",
                        search_height: "",
                        keyword: ""
                    };
                },
                components: {
                    gracePage: function() {
                        a.e("graceUI/components/gracePage").then(function() {
                            return resolve(a("1021"));
                        }.bind(null, a)).catch(a.oe);
                    },
                    graceNavBar: function() {
                        a.e("graceUI/components/graceNavBar2").then(function() {
                            return resolve(a("e74d"));
                        }.bind(null, a)).catch(a.oe);
                    }
                },
                props: {},
                onReady: function() {
                    var e = this;
                    return r(o.default.mark(function t() {
                        return o.default.wrap(function(t) {
                            for (;;) switch (t.prev = t.next) {
                              case 0:
                                return t.next = 2, e.$onLaunched;

                              case 2:
                              case "end":
                                return t.stop();
                            }
                        }, t);
                    }))();
                },
                onReachBottom: function() {
                    "nomore" != this.loadStatus && this.loadMallgoodslist();
                },
                onShow: function(t) {
                    var n = this;
                    return r(o.default.mark(function t() {
                        var e;
                        return o.default.wrap(function(t) {
                            for (;;) switch (t.prev = t.next) {
                              case 0:
                                return t.next = 2, n.$onLaunched;

                              case 2:
                                i.getStorageSync("openid") && (e = c.globalData.util.url("entry/wxapp/api", {
                                    m: c.globalData.module_name,
                                    o: "chkpid"
                                }), i.request({
                                    url: e,
                                    method: "POST",
                                    header: {
                                        "content-type": "application/x-www-form-urlencoded"
                                    },
                                    data: {
                                        openid: i.getStorageSync("openid")
                                    },
                                    success: function(t) {
                                        t = c.globalData.crypt.Decrypt(t.data.data.data, t.data.data.key), t = JSON.parse(t);
                                        i.setStorageSync("pid_use_time", t), i.getStorageSync("pid_time") != i.getStorageSync("pid_use_time") && (i.setStorageSync("elmwm_url", ""), 
                                        i.setStorageSync("elmsc_url", ""), i.setStorageSync("elmwmposter", ""), i.setStorageSync("elmscposter", ""), 
                                        i.setStorageSync("pid_time", i.getStorageSync("pid_use_time")));
                                    }
                                })), i.hideLoading(), n.windowHeight = i.getStorageSync("windowHeight");

                              case 5:
                              case "end":
                                return t.stop();
                            }
                        }, t);
                    }))();
                },
                onPageScroll: function(t) {
                    var e;
                    0 == this.headerHeight && (e = this, i.createSelectorQuery().select("#navheader").fields({
                        size: !0
                    }, function(t) {
                        console.log(t), t && (e.headerHeight = t.height);
                    }).exec()), this.scrollTop = t.scrollTop, 100 < this.headerHeight && t.scrollTop >= this.headerHeight ? (this.isFixed = !0, 
                    this.nav_margin_top = i.getStorageSync("headerHeight") + "px", this.nav_padding_top = "15rpx") : (this.isFixed = !1, 
                    this.nav_margin_top = "15rpx", this.nav_padding_top = "0rpx");
                },
                onLoad: function(t) {
                    var a = this;
                    return r(o.default.mark(function t() {
                        var e, n;
                        return o.default.wrap(function(t) {
                            for (;;) switch (t.prev = t.next) {
                              case 0:
                                return t.next = 2, a.$onLaunched;

                              case 2:
                                (e = a).setting = i.getStorageSync("setting"), e.userinfo = i.getStorageSync("userinfo"), 
                                e.navItems = i.getStorageSync("setting").index_malltype, e.navType = i.getStorageSync("setting").index_malltype[0].type, 
                                e.navQuery = i.getStorageSync("setting").index_malltype[0].query, n = wx.getMenuButtonBoundingClientRect(), 
                                e.search_width = n.left - i.upx2px(40) + "px", e.search_height = 750 / i.getStorageSync("windowWidth") * n.height, 
                                e.background = {
                                    backgroundColor: e.setting.waimaittnew_lunbobgcolor
                                }, e.loadMallgoodslist(), i.hideLoading();

                              case 16:
                              case "end":
                                return t.stop();
                            }
                        }, t);
                    }))();
                },
                onShareAppMessage: function() {
                    var t = "pages/index/index?uid=" + i.getStorageSync("userinfo").user_id;
                    return {
                        title: this.sharetitle,
                        imageUrl: this.sharepic,
                        path: t
                    };
                },
                methods: {
                    clear: function() {
                        this.keyword = "";
                    },
                    openGoods: function(t) {
                        "youxuan" == t.currentTarget.dataset.pingtai ? i.navigateToMiniProgram({
                            appId: t.currentTarget.dataset.appid,
                            path: t.currentTarget.dataset.path
                        }) : "group" == t.currentTarget.dataset.pingtai ? i.navigateTo({
                            url: "../meituangroup/detail?id=".concat(t.currentTarget.dataset.shopid, "&cat0_id=").concat(t.currentTarget.dataset.cat0_id, "&lng=").concat(i.getStorageSync("lon"), "&lat=").concat(i.getStorageSync("lat"), "&cityid=").concat(t.currentTarget.dataset.city_id)
                        }) : i.navigateTo({
                            url: "../../pagesA/pages/mallA/detail?pt=" + t.currentTarget.dataset.pingtai + "&goodsid=" + t.currentTarget.dataset.goodsid + "&goodssign=" + t.currentTarget.dataset.goodssign
                        });
                    },
                    navChange: function(t) {
                        i.showLoading({
                            title: "加载中...",
                            mask: !1
                        }), this.scrollTop >= this.headerHeight && i.pageScrollTo({
                            scrollTop: this.headerHeight,
                            duration: 0
                        }), this.navIndex = t, this.navType = this.navItems[t].type, this.navQuery = this.navItems[t].query, 
                        this.mallpage = 1, this.loadStatus = "loadmore", "youxuan" == this.navItems[t].type && i.getStorageSync("lon") && i.getStorageSync("lat") || "youxuan" != this.navItems[t].type ? this.loadMallgoodslist() : this.getLocation();
                    },
                    showDialog1: function() {
                        this.$refs.showAlert_taobaoauth.open();
                    },
                    closeDialog1: function() {
                        this.$refs.showAlert_taobaoauth.hide();
                    },
                    showDialog2: function() {
                        this.$refs.showAlert_login.open();
                    },
                    closeDialog2: function() {
                        this.$refs.showAlert_login.hide();
                    },
                    showDialog3: function() {
                        this.$refs.showAlert.open();
                    },
                    closeDialog3: function() {
                        this.$refs.showAlert.hide();
                    },
                    getWxCode: function() {
                        var e = this;
                        wx.login({
                            success: function(t) {
                                e.wxCode = t.code;
                            }
                        });
                    },
                    login: function(e) {
                        var n = this;
                        this.closeDialog2(), i.getSetting({
                            success: function(t) {
                                t.authSetting["scope.userInfo"] ? i.getUserInfo({
                                    success: function(t) {
                                        n.userAuth(e, t.userInfo, "login");
                                    }
                                }) : n.userAuth(e, null, "login");
                            }
                        });
                    },
                    getUserProfile: function() {
                        var n = this;
                        wx.getUserProfile({
                            desc: "请完善会员资料",
                            success: function(t) {
                                console.log(t.userInfo);
                                var e = c.globalData.util.url("entry/wxapp/userinfo2", {
                                    m: c.globalData.module_name
                                }), t = {
                                    avatarUrl: t.userInfo.avatarUrl,
                                    nickName: t.userInfo.nickName,
                                    openid: i.getStorageSync("openid")
                                };
                                i.request({
                                    url: e,
                                    method: "POST",
                                    header: {
                                        "content-type": "application/x-www-form-urlencoded"
                                    },
                                    data: t,
                                    success: function(t) {
                                        1 == t.data.status && (i.setStorageSync("userinfo", t.data.data.userinfo), n.userinfo = t.data.data.userinfo, 
                                        n.closeDialog2(), i.showToast({
                                            title: "登录成功",
                                            icon: "none"
                                        }));
                                    }
                                });
                            }
                        });
                    },
                    userAuth: function(n, t, a) {
                        var o = this;
                        "getUserInfo:ok" == n.detail.errMsg && wx.login({
                            success: function(t) {
                                var e = c.globalData.util.url("entry/wxapp/api", {
                                    m: c.globalData.module_name,
                                    o: "userinfo"
                                }), t = {
                                    code: t.code,
                                    encryptedData: n.detail.encryptedData,
                                    iv: n.detail.iv,
                                    openid: i.getStorageSync("openid"),
                                    invite_uid: wx.getStorageSync("invite_uid")
                                };
                                i.request({
                                    url: e,
                                    method: "POST",
                                    header: {
                                        "content-type": "application/x-www-form-urlencoded"
                                    },
                                    data: t,
                                    success: function(t) {
                                        var e;
                                        1 == ret.data.status && (e = c.globalData.crypt.Decrypt(ret.data.data.data, ret.data.data.key), 
                                        e = JSON.parse(e), i.setStorageSync("userinfo", e.userinfo), o.userinfo = e.userinfo, 
                                        "login" == a && (o.closeDialog2(), i.showToast({
                                            title: "登录成功",
                                            icon: "none"
                                        })));
                                    }
                                });
                            }
                        });
                    },
                    closeAlert: function() {
                        this.closeDialog2();
                    },
                    loadMallgoodslist: function() {
                        var t, n = this;
                        "youxuan" != n.navType || 0 < i.getStorageSync("lat") && 0 < i.getStorageSync("lon") ? (n.loadStatus = "loading", 
                        t = c.globalData.util.url("entry/wxapp/mallgoodslist", {
                            m: c.globalData.module_name
                        }), i.request({
                            url: t,
                            method: "POST",
                            header: {
                                "content-type": "application/x-www-form-urlencoded"
                            },
                            data: {
                                openid: i.getStorageSync("openid"),
                                type: n.navType,
                                query: n.navQuery,
                                page: n.mallpage,
                                pagesize: n.mallpagesize,
                                lon: i.getStorageSync("lon"),
                                lat: i.getStorageSync("lat")
                            },
                            success: function(t) {
                                var e;
                                200 == t.data.code && (e = t.data.mallgoodslist, 1 == t.data.has_more ? n.loadStatus = "loadmore" : n.loadStatus = "nomore", 
                                n.mallpage = t.data.page, 1 == n.mallpage ? (n.mallpagesize = t.data.pagesize, n.mallgoodslist = [], 
                                n.mallgoodslist = e) : n.mallgoodslist = n.mallgoodslist.concat(e), n.mallpage++), 
                                i.hideLoading(), i.stopPullDownRefresh();
                            }
                        })) : n.getLocation();
                    },
                    getLocation: function() {
                        var n = this;
                        i.getLocation({
                            type: "wgs84",
                            success: function(t) {
                                var e = c.globalData.util.url("entry/wxapp/address", {
                                    m: c.globalData.module_name
                                });
                                i.setStorageSync("lon", t.longitude), i.setStorageSync("lat", t.latitude), i.request({
                                    url: e,
                                    method: "POST",
                                    header: {
                                        "content-type": "application/x-www-form-urlencoded"
                                    },
                                    data: {
                                        lon: t.longitude,
                                        lat: t.latitude
                                    },
                                    success: function(t) {
                                        i.setStorageSync("cityCode", t.data.data.cityCode), i.setStorageSync("city", t.data.data.city), 
                                        i.setStorageSync("cityid", t.data.data.ci), 0 < t.data.data.ci && 0 < i.getStorageSync("lat") ? n.loadMallgoodslist() : i.showModal({
                                            title: "系统提示",
                                            content: "请授权获取您的位置信息",
                                            showCancel: !0,
                                            success: function(t) {
                                                t.confirm && n.again_getLocation(), n.mallgoodslist = [], n.loadStatus = "nomore", 
                                                i.setStorageSync("lon", ""), i.setStorageSync("lat", ""), i.setStorageSync("cityCode", ""), 
                                                i.setStorageSync("city", ""), i.setStorageSync("cityid", ""), i.hideLoading();
                                            }
                                        });
                                    }
                                });
                            },
                            fail: function(t) {
                                n.mallgoodslist = [], n.loadStatus = "nomore", i.setStorageSync("lon", ""), i.setStorageSync("lat", ""), 
                                i.setStorageSync("cityCode", ""), i.setStorageSync("city", ""), i.setStorageSync("cityid", ""), 
                                i.hideLoading();
                            }
                        });
                    },
                    again_getLocation: function() {
                        var e = this;
                        i.getSetting({
                            success: function(t) {
                                null != t.authSetting["scope.userLocation"] && 1 != t.authSetting["scope.userLocation"] ? i.showModal({
                                    title: "是否授权当前位置",
                                    content: "需要获取您的地理位置，请确认授权，否则无法获取您所需数据",
                                    success: function(t) {
                                        t.cancel ? i.showToast({
                                            title: "授权失败",
                                            icon: "success",
                                            duration: 1e3
                                        }) : t.confirm && i.openSetting({
                                            success: function(t) {
                                                1 == t.authSetting["scope.userLocation"] ? (i.showToast({
                                                    title: "授权成功",
                                                    icon: "success",
                                                    duration: 1e3
                                                }), e.getLocation(e)) : i.showToast({
                                                    title: "授权失败",
                                                    icon: "success",
                                                    duration: 1e3
                                                });
                                            }
                                        });
                                    }
                                }) : (t.authSetting["scope.userLocation"], e.getLocation(e));
                            }
                        });
                    }
                }
            };
            n.default = e;
        }).call(this, a("543d").default);
    },
    "62c8": function(t, e, n) {
        n.r(e);
        var a, o = n("3c72"), i = n.n(o);
        for (a in o) "default" !== a && function(t) {
            n.d(e, t, function() {
                return o[t];
            });
        }(a);
        e.default = i.a;
    },
    "8d21": function(t, e, n) {
        (function(t) {
            function e(t) {
                return t && t.__esModule ? t : {
                    default: t
                };
            }
            n("0cda"), e(n("66fd")), t(e(n("a547")).default);
        }).call(this, n("543d").createPage);
    },
    "9de6": function(t, e, n) {
        n.d(e, "b", function() {
            return o;
        }), n.d(e, "c", function() {
            return i;
        }), n.d(e, "a", function() {
            return a;
        });
        var a = {
            uSearch: function() {
                return n.e("uview-ui/components/u-search/u-search").then(n.bind(null, "6bb4"));
            },
            uImage: function() {
                return n.e("uview-ui/components/u-image/u-image").then(n.bind(null, "871d"));
            },
            uLoading: function() {
                return n.e("uview-ui/components/u-loading/u-loading").then(n.bind(null, "54b5"));
            },
            uIcon: function() {
                return n.e("uview-ui/components/u-icon/u-icon").then(n.bind(null, "bee6"));
            },
            uGap: function() {
                return n.e("uview-ui/components/u-gap/u-gap").then(n.bind(null, "130d"));
            },
            uEmpty: function() {
                return n.e("uview-ui/components/u-empty/u-empty").then(n.bind(null, "b399"));
            },
            uButton: function() {
                return n.e("uview-ui/components/u-button/u-button").then(n.bind(null, "cad8"));
            },
            uLoadmore: function() {
                return n.e("uview-ui/components/u-loadmore/u-loadmore").then(n.bind(null, "2220"));
            },
            uBackTop: function() {
                return n.e("uview-ui/components/u-back-top/u-back-top").then(n.bind(null, "feb3"));
            }
        }, o = function() {
            this.$createElement;
            this._self._c;
        }, i = [];
    },
    a547: function(t, e, n) {
        n.r(e);
        var a, o = n("9de6"), i = n("62c8");
        for (a in i) "default" !== a && function(t) {
            n.d(e, t, function() {
                return i[t];
            });
        }(a);
        n("ddf0");
        var r = n("f0c5"), o = Object(r.a)(i.default, o.b, o.c, !1, null, null, null, !1, o.a, void 0);
        e.default = o.exports;
    },
    b06c: function(t, e, n) {},
    ddf0: function(t, e, n) {
        var a = n("b06c");
        n.n(a).a;
    }
}, [ [ "8d21", "common/runtime", "common/vendor" ] ] ]);